<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>商品管理</title>
<style>
body {
	background-image:
		url('${pageContext.request.contextPath }/images/b.gif');
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
}
</style>
<style>
button {
	width: 390px; /*设置按钮宽度*/
	height: 40px; /*设置按钮高度*/
	color: white; /*字体颜色*/
	background-color: #004B97; /*按钮背景颜色*/
	border-radius: 3px; /*让按钮变得圆滑一点*/
	border-width: 0; /*消去按钮丑的边框*/
	margin: 0;
	outline: none; /*取消轮廓*/
	font-family: KaiTi; /*字体设置为楷体*/
	font-size: 20px; /*设置字体大小*/
	text-align: center; /*字体居中*/
	cursor: pointer; /*设置鼠标箭头手势*/
}

button:hover { /*鼠标移动时的颜色变化*/
	background-color: green;
	width: 400px; /*设置按钮宽度*/
	height: 42px; /*设置按钮高度*/
}
</style>
<style>
#left {
	width: 43%;
	float: left;
	text-align: right
}

#right {
	width: 43%;
	float: right;
}
</style>
<style>
a:link {
	text-decoration: none;
} /* 未被访问的链接 */
a:visited {
	text-decoration: none;
} /* 已被访问的链接 */
a:hover {
	text-decoration: underline;
} /* 鼠标指针移动到链接上 */
a:active {
	text-decoration: underline;
} /* 正在被点击的链接 */
</style>
<style>
h1 {
	text-align: center;
}
</style>

<style>
aaa {
	width: 10px;
	top: 200px;
	left: 500px;
	display: block;
	margin: 2;
}
</style>
<style>
table {
	text-align: center;
	width: 800px;
	border-width: 6px;
	border-style: solid;
	color: black;
}

td {
	width: 150px;
	border-width: 3px;
	border-style: solid;
}
</style>
</head>

<h1>商品管理</h1>
<script>
	function deleteCommodity() {
		alert("你好，我是一个警告框！");
	}
</script>
<body>
	<div class="aaa">
		<a href="../index.jsp">首页</a>
	</div>
	<div class="project" align="center">
		<button
			onclick="window.location.href = '${pageContext.request.contextPath }/commodity/list'">商品列表</button>
		<button
			onclick="window.location.href = '${pageContext.request.contextPath }/sell/list'">销售列表</button>
		<table id="tab" border="1" align="center">
			<tr>
				<td colspan="6" style="font-size: 20px">商品列表</td>
			</tr>
			<tr>
				<td colspan="6">
					<form method="post"
						action=" ${pageContext.request.contextPath }/commodity/select">
						<input name="id" type="text" /> <span id="buttons"> <input
							id="submit" type="submit" value="查询" />
						</span> <span style="color: red">${error }</span>
					</form>
				</td>
			</tr>
			<tr>
				<td>商品ID</td>
				<td>商品名称</td>
				<td>库存</td>
				<td>价格</td>
				<td>类别</td>
				<td><a href="tocommodity_add">增加</a></td>
			</tr>
			<!-- JSTL标签，请参考本书的相关内容 -->
			<c:forEach items="${commoditys}" var="commodity">
				<tr>
					<td>${commodity.commodity_Id }</td>
					<td>${commodity.commodity_Name }</td>
					<td>${commodity.commodity_Stock }</td>
					<td>${commodity.commodity_Price}</td>
					<td>${commodity.commodity_Type }</td>
					<td><a
						href="${pageContext.request.contextPath }/commodity/delete?cid=${commodity.getCommodity_Id()}">删除</a>︱<a
						href="${pageContext.request.contextPath }/commodity/toupdate?cid=${commodity.getCommodity_Id()}">修改</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>